<ui:composition xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	template="template/template.xhtml">
	<ui:define name="title">
		<h:outputText value="#{msgs.scriptsVisualization}"/>
	</ui:define>
	<ui:define name="bodyInclude">
		<ui:include src="include/menu.xhtml" />
		<p:fieldset legend=" #{msgs.scriptsVisualization}: #{scriptsVisualisationController.currentHierarchy.project.name}-#{scriptsVisualisationController.currentHierarchy.version.name}" toggleable="true">
			<p:outputPanel layout="block" styleClass="container">
				<h:form id="scriptsVisualizationForm">
					<p:dataTable currentPageReportTemplate="{currentPage} #{msgs.of} {totalPages}" emptyMessage="#{msgs.emptyDataTableMessage}" id="scriptsTable" paginator="true" paginatorAlwaysVisible="false" paginatorTemplate="{FirstPageLink} {PreviousPageLink} {CurrentPageReport}{PageLinks}{NextPageLink} {LastPageLink}" rows="10" rowsPerPageTemplate="5,10,20,50" value="#{scriptsVisualisationController.hiearchyScripts}" var="script">
						<p:column headerText="#{msgs.id}" sortBy="#{script.scriptId}" styleClass="center">
							<h:outputText value="#{script.scriptId}"/>
						</p:column>
						<p:column headerText="#{msgs.label}" sortBy="#{script.label}" styleClass="center">
							<p:inplace effect="slide" effectSpeed="fast" emptyLabel="#{msgs.clickHereToUpdateThisField}" widgetVar="scriptLabelInplace#{script.scriptId}">
								<p:inputText value="#{script.label}" />
								<p:commandButton action="#{scriptsVisualisationController.onEditScriptLabel}" alt="#{msgs.updateValue}" image="ui-icon ui-icon-check" oncomplete="scriptLabelInplace#{script.scriptId}.hide()" process="@parent" title="#{msgs.updateValue}" update="scriptsVisualizationForm:scriptsTable">
									<f:setPropertyActionListener target="#{scriptsVisualisationController.currentEditedScript}" value="#{script}" />
								</p:commandButton>
							</p:inplace>
						</p:column>
						<p:column headerText="#{msgs.actions}" styleClass="center">
							<p:commandButton action="#{scriptsVisualisationController.onScriptDetails}" alt="#{msgs.visualize}" image="ui-icon ui-icon-search" process="@this" title="#{msgs.visualize}">
								<f:setPropertyActionListener target="#{scriptsVisualisationController.currentScript}" value="#{script}" />
							</p:commandButton>
						</p:column>
					</p:dataTable>
					<p:outputPanel layout="block" styleClass="buttonContainer center">
						<p:commandButton action="#{scriptsVisualisationController.onReturn}" image="ui-icon ui-icon-arrowthick-1-w" process="@this" value="#{msgs.back}"/>
					</p:outputPanel>
				</h:form>
			</p:outputPanel>
		</p:fieldset>
	</ui:define>
</ui:composition>